package com.cat;

import com.cat.model.User;
import com.cat.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class MainApp {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(MainApp.class, args);

        //下面为辅助测试代码，实际使用过程中不需要
        UserService userService = context.getBean(UserService.class);
        User user = userService.findByName("haha");
        System.out.println(user.getName());
        System.out.println(user.getId());
        System.out.println(user.getCreateTime());
    }
}
